<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>小米商城后台管理系统</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/type.css" />
<script type="text/javascript" src="__PUBLIC__/js/admin.js"></script>
<script>
	$(function(){
		$("#categorysel,#status,#Is_best").change(function(){
			window.location.href = "__ACTION__/GoodcategoryId/" + $("#categorysel").val()+'/Status/'+$("#status").val()+''+'/Is_best/'+$("#Is_best").val();
		});


		$("#excel").click(function(){
			window.location.href = "__CONTROLLER__/goods2Excel";
			});
		
	});
</script>
<style>
/*分页列表*/
.pagelist {
text-align:center;
	margin-top: 10px;
}

.pagelist a {
	margin: 0 5px;
	border: 1px solid #ddd;
	padding: 1px 4px;
	color: #666;
}

.pagelist a:hover {
	text-decoration: none;
}

.pagelist span {
	padding: 1px 4px;
}
</style>
</head>
<body>
<br>
<br>


<table class="classify_table1">
	<td><span class="classify_table_title">商品管理</span> &emsp;&emsp;
	<input type="button" id="excel" value="打印商品列表"/>
	<form method="post"
	action="__CONTROLLER__/xiajiaSelect/GoodcategoryId/{$GoodcategoryId}" style="display:inline">
	<span
		class="classify_table_button"> <input type="button"
		id="xiajiaselect_btn" value="下架"> </span> <span
		class="classify_table_button">
	<input type="button" value="新增" onclick="javascrtpt:window.location.href='__CONTROLLER__/addGoods'">
	
	</span> <span class="classify_table_button"> <a
		href="__ACTION__/GoodcategoryId/{$GoodcategoryId}/order/GoodId asc"
		style="font-size: 0.8em; line-height: 30px">正序</a> <a id="asc"
		style="font-size: 0.8em; line-height: 30px"
		href="__ACTION__/GoodcategoryId/{$GoodcategoryId}/order/GoodId desc">倒序</a>
	</span></td>
	</tr>
	<tr>
		<td>
		<table class="classify_table2">
			<tr>
				<td class="classify_thead_checkbox"><input type="checkbox"
					onclick="DoCheck()" id="allChecked"></td>
				<td class="classify_thead_title">商品编号</td>
				<td class="classify_thead_title">商品名称</td>
				<td class="classify_thead_title ">商品颜色</td>
				<td class="classify_thead_title ">商品型号</td>
				<td class="classify_thead_title">价格</td>
				<td class="classify_thead_title ">数量</td>
				<td class="classify_thead_title ">状态 <select name="Status"
					id="status" class="goods_select">
					<option value="0"<eq name="statu" value="0">selected</eq>
					>全部</option>
					<option value="1"<eq name="statu" value="1">selected</eq>
					>上架</option>
					<option value="2"<eq name="statu" value="2">selected</eq>
					>下架</option>
				</select></td>
				<td class="classify_thead_title ">推荐 <select name="Is_best"
					id="Is_best" class="goods_select">
					<option value="0"<eq name="isbest" value="0">selected</eq>
					>全部</option>
					<option value="1"<eq name="isbest" value="1">selected</eq>
					>是</option>
					<option value="2"<eq name="isbest" value="2">selected</eq>
					>否</option>
				</select></td>
				<td class="classify_thead_title ">分类 <select id="categorysel"
					name="GoodcategoryId">
					<option value="0">全部</option>
					<foreach name="goodcategory" item="v">
					<option value="{$v.GoodcategoryId}"<eq
						name="v.GoodcategoryId" value="$GoodcategoryId">selected</eq>
					>{:str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;',$v['deep']).$v['CategoryName']}</option>
					</foreach>
				</select></td>
				<td class="classify_thead_title " colspan="2">管理</td>
			</tr>
			<foreach name="goods.list" item="v">
			<tr>
				<td class="classify_thead_checkbox"><input type="checkbox"
					name="goodids[]" class="choose" value="<?php echo
				$v['GoodId']."@@@".$v['Color']."@@@".$v['Version']?>"></td>
				<td class="classify_tbody">{$v.GoodId}</td>
				<td class="classify_tbody">{$v.GoodName}</td>
				<td class="classify_tbody"><neq name="v.Color" value="?">{$v.Color}</neq></td>
				<td class="classify_tbody"><neq name="v.Version" value="?">{$v.Version}</neq></td>
				<td class="classify_tbody">{$v.Price}</td>
				<td class="classify_tbody">{$v.Number}</td>
				<td class="classify_tbody"><a
					href="__CONTROLLER__/xiajiaGoods/GoodId/{$v.GoodId}/Color/{$v.Color}/Version/{$v.Version}/Status/{$v.Status}">
				<eq name="v.Status" value="1">上架中</eq> <eq name="v.Status" value="2">下架中</eq>
				</a> </select></td>
				<td class="classify_tbody"><a
					href="__CONTROLLER__/tuijianGoods/GoodId/{$v.GoodId}/Color/{$v.Color}/Version/{$v.Version}/Is_best/{$v.Is_best}">
				<eq name="v.Is_best" value="1">是</eq> <eq name="v.Is_best" value="2">否</eq></td>
				<td class="classify_tbody">{$v.CategoryName}</td>
				<td>
				<input type="button" value="编辑" onclick="javascrtpt:window.location.href='__CONTROLLER__/modifyGoods/goodids/<?php echo $v['GoodId']."@@@".$v['Color']."@@@".$v['Version']?>'">
				</td>
				<td>
				<input type="button" value="添加同款" onclick="javascrtpt:window.location.href='__CONTROLLER__/addCopy/goodids/<?php echo $v['GoodId']."@@@".$v['Color']."@@@".$v['Version']?>'">
				</td>
			</tr>
			</foreach>
		</table>
		</td>
	</tr>
<tr><td><div class="pagelist">{$goods.page}</div></td></tr>
</table>

</form>


<script>
//批量下架时使用
$('#xiajiaselect_btn').click(function(){
	if($(".choose:checked").length<=0){
		alert("勾选至少一个属性复选框，才能进行本操作！");
		retrun;}
	if(confirm('确定下架这些商品?'))
	{
		$('form').submit();
	}

});

</script>

</body>
</html>